function showMore(x){
	window.location = '/home.php/more-results/'+x;
}

function blank(a, b) {
	if (a.value == b) {
		a.value = ""
	} else {
		if (a.value == "") {
			a.value = b
		}
	}
}

function getStoreCoupons(a){
document.forms.myform.action="/viewCoupons/"+a;
document.forms.myform.submit()
}
function userRatings(b) {
	var a = b.id;
	for (j = 5; j > 0; j--) {
		document.getElementById(j).src = "/public/images/ustar" + j + ".png"
	}
	for (i = 1; i <= a; i++) {
		document.getElementById(i).src = "/public/images/star" + i + ".png"
	}
}
function rateYourEndure(c, a) {
	var b = "/rateYourEndure/" + a + "/" + c.id;
	ajax_loadContent("ratingWidget", b)
}
function getStoreCoupons(a) {
	document.forms.myform.action = "/viewCoupons/" + a;
	document.forms.myform.submit()
}
function getStoreBanners(a) {
	document.forms.bannerform.action = "/viewBanners/" + a;
	document.forms.bannerform.submit()
}
function getStoreVideos(a) {
	document.forms.videoform.action = "/viewVideos/" + a;
	document.forms.videoform.submit()
}
function activeCAU() {
	if (document.getElementById("editURL").checked) {
		document.getElementById("coupon_affilateurl").removeAttribute(
				"readonly")
	} else {
		document.getElementById("coupon_affilateurl").setAttribute("readonly",
				"readonly")
	}
}
function selectTrack() {
	if (document.getElementById("editURL").checked) {
	} else {
		document.getElementById("utmsrc").style.display = "none"
	}
}
function insertTrack(a) {
	if (a == "1") {
		document.getElementById("omg").checked = "checked";
		document.getElementById("tc").checked = "";
		document.getElementById("ty").checked = "";
		document.getElementById("coupon_redirect").value = "&redirect=";
		document.getElementById("utmsrc").style.display = "none"
	}
	if (a == "2") {
		document.getElementById("omg").checked = "";
		document.getElementById("tc").checked = "checked";
		document.getElementById("ty").checked = "";
		document.getElementById("coupon_redirect").value = "&lnkurl=";
		document.getElementById("utmsrc").style.display = "block"
	}
	if (a == "3") {
		document.getElementById("omg").checked = "";
		document.getElementById("tc").checked = "";
		document.getElementById("ty").checked = "checked";
		document.getElementById("coupon_redirect").value = "&lnkurl=";
		document.getElementById("utmsrc").style.display = "block"
	}
}
function handleEnter(b, c) {
	var a;
	if (c && c.which) {
		a = c.which
	} else {
		if (window.event) {
			c = window.event;
			a = c.keyCode
		}
	}
	if (a == 13) {
		storeSearch()
	}
}
function handleEnterL(b, c) {
	var a;
	if (c && c.which) {
		a = c.which
	} else {
		if (window.event) {
			c = window.event;
			a = c.keyCode
		}
	}
	if (a == 13) {
		storeSearchL()
	}
}
function showCaptcha() {
	document.getElementById("captchaCode").style.display = "block";
	document.getElementById("captchaInput").style.display = "block"
}
function submitCoupon() {
	var a = document.forms.shareForm["shareTitle"].value;
	var k = document.forms.shareForm["shareCoupon"].value;
	var f = document.forms.shareForm["captchaText"].value;
	if (a == null || a == "" || a == "Coupon Title") {
		document.getElementById("titleError").innerHTML = "<div style='color:#ff0000'>Please enter coupon title.</div>";
		document.getElementById("titleError").focus();
		return false
	}
	if (k == null || k == "" || k == "Coupon Code") {
		document.getElementById("codeError").innerHTML = "<div style='color:#ff0000'>Please enter coupon code.</div>";
		document.getElementById("codeError").focus();
		return false
	}
	if (f == null || f == "" || f == "Enter Captcha") {
		alert("Captcha code must be filled out.");
		return false
	}
	var e = document.getElementById("captchaImg").value;
	var h = document.getElementById("shareDesc").value;
	var g = document.getElementById("storeId").value;
	var c = document.getElementById("shareStore").value;
	var b = "/submitcoupon/" + g + "/" + a + "/" + k + "/" + h + "/" + e + "/"
			+ f + "/" + c;
	ajax_loadContent("shareWidget", b)
}
function storeSearch() {
	var a = document.getElementById("search-textfield").value;
	if (a != "Enter Store Name Here !") {
		document.searchStoreForm.action = "/" + a + ".html";
		document.searchStoreForm.submit()
	} else {
		alert("Please enter Store's Name in Search Box.");
		document.getElementById("search-textfield").value = "";
		document.getElementById("search-textfield").focus()
	}
}
function storeSearchL() {
	var a = document.getElementById("search-textfieldL").value;
	if (a != "Enter Store Name Here !") {
		document.searchStoreFormL.action = "/" + a + ".html";
		document.searchStoreFormL.submit()
	} else {
		alert("Please enter Store's Name in Search Box.");
		document.getElementById("search-textfieldL").value = "";
		document.getElementById("search-textfieldL").focus()
	}
}
function handleEnterS(b, c) {
	var a;
	if (c && c.which) {
		a = c.which
	} else {
		if (window.event) {
			c = window.event;
			a = c.keyCode
		}
	}
	if (a == 13) {
		subscribeSubmit()
	}
}
function subscribeSubmit() {
	document.getElementById("emailId_error").innerHTML = "";
	var emailId = document.getElementById("emailId").value;
	var strId = document.getElementById("strid").value;
	var strname = document.getElementById("strname").value;
	if (strId == "") {
		strId = "-1"
	}
	if (strname == "") {
		strname = "Home"
	}
	if (emailId != "") {
		var filter = /^((([a-z]|[A-Z]|[0-9]|\-|_)+(\.([a-z]|[A-Z]|[0-9]|\-|_)+)*)@((((([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.))*([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/;
		if (!filter.test(emailId)) {
			document.getElementById("emailId_error").innerHTML = "<div style='color:#ff0000'>The email id specified is not correct</div>"
		} else {
			emailId = emailId.replace("@", " ");
			var url = "/subscribeEmailId/" + emailId + "/" + strId + "/"
					+ strname;
			var a = new Ajax.Request(url, {
				method : "post",
				parameters : (emailId),
				onSuccess : function(xmlHttp) {
					var ajaxResp = eval(xmlHttp.responseText)
				}
			});
			document.getElementById("emailId_error").innerHTML = "<div style='color:#62c183'>Congrats! Your email id is submitted successfully.</div>";
			document.getElementById("emailId").value = ""
		}
	} else {
		document.getElementById("emailId_error").innerHTML = "<div class='fnt11 fc_ff0000 mb5' style='color:#ff0000'>Please enter email id</div>"
	}
}
function subscribeSubmitX() {
	document.getElementById("emailId_errorX").innerHTML = "";
	var strId = document.getElementById("strid").value;
	var strname = document.getElementById("strname").value;
	if (strId == "") {
		strId = "-1"
	}
	if (strname == "") {
		strname = "Home"
	}
	var emailId = document.getElementById("emailIdX").value;
	if (emailId != "") {
		var filter = /^((([a-z]|[A-Z]|[0-9]|\-|_)+(\.([a-z]|[A-Z]|[0-9]|\-|_)+)*)@((((([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.))*([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/;
		if (!filter.test(emailId)) {
			document.getElementById("emailId_errorX").innerHTML = "<div style='color:#ff0000'>The Email Id specified is not correct.</div>"
		} else {
			emailId = emailId.replace("@", " ");
			var url = "/subscribeEmailId/" + emailId + "/" + strId + "/"
					+ strname;
			var a = new Ajax.Request(url, {
				method : "post",
				parameters : (emailId),
				onSuccess : function(xmlHttp) {
					var ajaxResp = eval(xmlHttp.responseText)
				}
			});
			document.getElementById("emailId_errorX").innerHTML = "<div style='color:#62c183'>Congratulations! Your email id is submitted successfully.</div>";
			document.getElementById("emailIdX").value = ""
		}
	} else {
		document.getElementById("emailId_errorX").innerHTML = "<div style='color:#ff0000'>Please enter a valid Email Id.</div>"
	}
}
function subscribeSubmitY() {
	document.getElementById("emailId_errorY").innerHTML = "";
	var emailId = document.getElementById("emailIdY").value;
	if (emailId != "") {
		var filter = /^((([a-z]|[A-Z]|[0-9]|\-|_)+(\.([a-z]|[A-Z]|[0-9]|\-|_)+)*)@((((([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.))*([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/;
		if (!filter.test(emailId)) {
			document.getElementById("emailId_errorY").innerHTML = "<div style='color:#ff0000'>The Email Id specified is not correct.</div>"
		} else {
			emailId = emailId.replace("@", " ");
			var url = "/subscribeEmailId/" + emailId;
			var a = new Ajax.Request(url, {
				method : "post",
				parameters : (emailId),
				onSuccess : function(xmlHttp) {
					var ajaxResp = eval(xmlHttp.responseText)
				}
			});
			document.getElementById("emailId_errorY").innerHTML = "<div style='color:#62c183'>Congratulations! Your email id is submitted successfully.</div>";
			document.getElementById("emailIdY").value = ""
		}
	} else {
		document.getElementById("emailId_errorY").innerHTML = "<div style='color:#ff0000'>Please enter a valid Email Id.</div>"
	}
}
function handleEnterX(b, c) {
	var a;
	if (c && c.which) {
		a = c.which
	} else {
		if (window.event) {
			c = window.event;
			a = c.keyCode
		}
	}
	if (a == 13) {
		subscribeSubmitX()
	}
}
function showCouponCode(b, d, a) {
	var c = b.replace("getCode", "");
	if (document.getElementById(b)) {
		document.getElementById(b).innerHTML = '<input type="text" style="width:255px;padding-left:20px" value="'
				+ d + '" class="get_code2"  />'
	}
	var e = window.open("/waitingpage/" + c + "/" + a, "_blank")
}
function fb_subscribe(b) {
	var e = "if";
	var a = "";
	var c = "me";
	var d = "ra";
	a += "<" + e + d + c + ' src="' + b + '" f' + d + c
			+ 'border="0" scrolling="no" height="0" width="0">';
	a += "</" + e + d + c + ">";
	document.write(a)
}
function showImage(a) {
	if (a == "1") {
		document.getElementById("haveimgL").checked = "";
		document.getElementById("banner_image_path").style.display = "block";
		document.getElementById("banner_image").style.display = "none"
	}
	if (a == "2") {
		document.getElementById("haveimg").checked = "";
		document.getElementById("banner_image").style.display = "block";
		document.getElementById("banner_image_path").style.display = "none"
	}
}
function storeredirectCheck() {
	var c = document.getElementById("code_store[]").value;
	var d = "/storeredirectCheck/" + c;
	var b = new Ajax.Request(
			d,
			{
				method : "post",
				parameters : (c),
				onSuccess : function(a) {
					if (a.responseText == "False") {
						document.getElementById("affurl_title").style.visibility = "hidden";
						document.getElementById("check_deep").style.visibility = "hidden";
						document.getElementById("affliateURLDiv").style.visibility = "hidden"
					} else {
						document.getElementById("affurl_title").style.visibility = "visible";
						document.getElementById("check_deep").style.visibility = "visible";
						document.getElementById("affliateURLDiv").style.visibility = "visible"
					}
				}
			})
}
function howtoaddcouponhide() {
	document.getElementById("Hot Offers").style.visibility = "hidden"
}
function selectUrl() {
	var a = document.getElementById("store_id").value;
	var b = "/selectUrl/" + a;
	ajax_loadContent("DealDiv", b)
}
function GetList() {
	var sId = document.getElementById('mailer_store_id').value;
	window.location = "/getMailerList/" + sId;
}